package com.lagouedu.kucun.miaosha.config;

import org.apache.rocketmq.client.exception.MQClientException;
import org.apache.rocketmq.client.producer.DefaultMQProducer;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class RocketConfig {

    @Bean
    DefaultMQProducer initDefaultMQProducer() throws MQClientException {
        DefaultMQProducer producer = new DefaultMQProducer("tx_producer_grp");
        producer.setNamesrvAddr("localhost:9876");
        producer.start();
        return producer;
    }
}
